//
//  H264Decoder.h
//  IntellDev_new
//
//  Created by os on 2021/3/9.
//

#import <Foundation/Foundation.h>

#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>

#include "H264DecoderDefine.h"

NS_ASSUME_NONNULL_BEGIN

@protocol updateDecodedH264FrameDelegate <NSObject>

@optional

- (void)updateDecodeH264FrameData:(H264YUV_Frame *)yuvFrame;

@end

@interface H264Decoder : NSObject
{
    AVCodec         *pCodec;
    AVCodecContext  *pCodecCtx;
    AVFrame         *pVideoFrame;
    
    AVPacket        pAvpackage;
    
    int             pictureWidth;
    int             setRecordResolveState;
    int             startCodeType;
}

@property (nonatomic, weak) id<updateDecodedH264FrameDelegate> updateDelegate;

- (int)DecodeH264Frames:(unsigned char *)inputBuffer withLength:(int)length;

@end

NS_ASSUME_NONNULL_END
